/*
 * @name:问卷回答表(question_reply)
 * @content:
 * @Author: joyce
 * @Date: 2020-05-28 21:36:54
 */

var mongoose = require("mongoose");
var question_replySchema = new mongoose.Schema({
  question_id: { type: mongoose.SchemaTypes.ObjectId, ref: "question" }, //问卷表_id
  user_id: { type: mongoose.SchemaTypes.ObjectId, ref: "user_login" }, //用户_id
  option: [
    {
      optiontitle: { type: String }, //选项标题
      optiontype: { type: Number }, //选择类型 1单选 2多选 3填空
      subopitonstitile: { type: Array }, //选择的子选项标题   填空选项的标题（用户填写）类型为1 3显示
      mulopitonstitile: { type: Array } //多选的子选项标题   类型2显示
    }
  ], //子选项
  option_time: { type: Date, default: new Date() } //问卷时间
});

module.exports = mongoose.model("question_reply", question_replySchema);
